controllerModule.controller("MerchantListCtrl",["$scope","$routeParams","$http",function($scope,$routeParams,$http){
    $scope.searchKey = $routeParams.searchKey;
    $scope.searchResultArr = [];
    $http({
        method: 'post',
        url: rootPath + '/api/business/findForPage',
        data:{
        	"visitFrom":"weixin",
        	"businessName":$scope.searchKey
        }
    }).then(function successCallback(response) {
    	console.log(response);
    	$scope.searchResultArr = response.data.data.data;
    	console.log($scope.searchResultArr);
    }, function errorCallback(response) {
        alert(response)
    });
    
    $scope.goTelephone = function(id){
    	$http({
            method: 'get',
            url: rootPath + '/api/business/visit',
            params:{
            	"visitType":'2',
            	"businessId": id
            }
        }).then(function successCallback(response) {
        	console.log(response);
        }, function errorCallback(response) {
            alert(response)
        });
    }
}]);